﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Media;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Spelprojekt
{
    /// <summary>
    /// Klass för ett Monster. Härifrån anropas rörelse.
    /// </summary>
    class Monster1
    {
        public Rectangle MonstRectangle = new Rectangle(800, 0, 156, 116);
        public int life = 3;
        public bool dead = false;
        Random slump = new Random();
        public int gameOverFalling;
        int speedX = -2;
        int speedY;
        public Monster1()
        {
            gameOverFalling = slump.Next(-50, -10);
            speedY = slump.Next(-4, 5);
            MonstRectangle.Y = slump.Next(0, 400);
        }
        /*! Rörelsefunktion för ett monster.*/
        public void Move()
        {
            MonstRectangle.X += speedX;

            if (MonstRectangle.Y >= 384 && speedY > 0)
                speedY = -speedY;
            if (MonstRectangle.Y <= 0 && speedY < 0)
                speedY = -speedY;

            MonstRectangle.Y += speedY;
        }
    }
}
